#include<stdio.h>
const int n=50000;
int main()
{
	long long sum=0;
	for(long long i=1;i<=n;i++){
		for(long long j=1;j<=n;j++){
			if(i*i+j*j<=(long long)n*n)
				sum++;
		}
	}
	sum*=4;
	printf("%lld",sum);
	return 0;
}
